package com.atguigu.f_overload;

public class Demo {
    public static void main(String[] args) {
        System.out.println(sum(10, 20, 30));

        System.out.println(sum(10, 20));
        System.out.println("--------------------");
        char[] chs = {'a','b'};

        System.out.println(chs);

        System.out.println("chs = " + chs);
    }

    public static int sum(int a,int b){
        System.out.println("int + int");
        return a + b;
    }

    //类型顺序
    public static double sum(double a,int b){
        System.out.println("double + int");
        return a + b;
    }

    public static double sum(int a,double b){
        System.out.println("int + double");
        return a + b;
    }

    //类型不同
    public static double sum(double a,double b){
        System.out.println("double + double");
        return a + b;
    }

    //个数不同
    public static int sum(int a,int b,int c){
        System.out.println("int + int + int");
        return a + b + c;
    }
}
